package org.shiwen.week2;
//精度转换
public class Transfer {
    public static void main(String[] args) {
        //高精度转低精度
        int a = 123456789;
        long b = a;
        System.out.println(b);
        //低精度转高精度
        long c = 123456789999L;
        //如果不用强制转换，会发生错误
        //int d = c;
        int e = (int)c;
        System.out.println(e);
        //字符转数字
        char x = '1';
        int y = x;
        System.out.println(y);
        //字符也可以做加法，会按unicode码进行加法
        x = (char)(x+1);
        System.out.println(x);
    }
}
